﻿@model GameSchoolWeb.Models.CourseIndexModelView
<div id="templatemo_content">
    @{
        ViewBag.Title = "Námskeið";
    }
    <div class="templatemo_box">
        <h2>
            Námskeið</h2>
        <div class="body">
            <div class="display-label">
                <strong>Námskeið</strong></div>
            <div class="display-field">
                @Html.DisplayFor(model => model.Course.strName)
            </div>
            <div class="display-label">
                <strong>Lýsing</strong></div>
            <div class="display-field">
                @Html.DisplayFor(model => model.Course.strCourseDescription)
            </div>
            <div class="display-label">
                <strong>Umsjónarkennari</strong></div>
            <div class="display-field">
                @Html.DisplayFor(model => model.Course.strCourseMaster)
            </div>
            <hr />
            <table>
                <tr>
                    <th>
                        Borð
                    </th>
                </tr>
                @foreach (var item in Model.LevelList)
                {
                    <tr>
                        <td>
                            @Html.ActionLink("Borð " + item.nLvlNumber, "GetLevel", new { id = item.id })
                        </td>
                    </tr>
                }
            </table>
            @if (User.IsInRole("Kennari"))
            {
    
                <p>
                    <hr />
                    @Html.ActionLink("Setja inn frétt", "AddNews", new { id = Model.Course.id })
                    <hr />
                    @Html.ActionLink("Setja inn borð", "DefineLevels", new { id = Model.Course.id })
                </p>
            }
            <hr />
            <div id="templatemo_box">
                <h3>
                    Nýjustu tilkynningar frá kennara</h3>
            </div>
            @foreach (var item in Model.NewsItems)
            {
                <div class="display-label">
                    <strong>@Html.DisplayFor(model => item.strNewsTitle)</strong></div>
                <div class="display-field">
                    @Html.DisplayFor(model => item.strNewsContent)
                    @Html.DisplayFor(model => item.dDateCreated)
                </div>
            }
        </div>
        <div class="box_bottom">
            <span></span>
        </div>
    </div>
</div>
